import blue
import uix
import uicls
import uiutil
import uiconst

class DropDownMenu(uicls.DropDownMenuCore):
    __guid__ = 'uicls.DropDownMenu'

    def Prepare_Background_(self, *args):
        underlay = blue.os.LoadObject('res:/UI/Component/wnd_underlay.blue')
        underlay.left = -3
        underlay.top = -3
        underlay.width = -3
        underlay.height = -3
        color = uiutil.GetChild(underlay, 'color')
        color.tripass = blue.rot.GetInstance('res:/UI/Pass/wndColor_ExclAlpha.blue')
        c = blue.rot.GetInstance('res:/UI/Pass/wndColor.blue').textureStage0.customColor
        blue.rot.GetInstance('res:/UI/Pass/wndColor_ExclAlpha.blue').textureStage0.customColor.SetRGB(c.r, c.g, c.b, 1.0)
        self.children.append(underlay)




class MenuEntryView(uicls.MenuEntryViewCore):
    __guid__ = 'uicls.MenuEntryView'

    def Prepare_Label_(self, *args):
        label = uicls.Label(text='', parent=self, left=8, top=1, letterspace=1, fontsize=10, state=uiconst.UI_DISABLED, align=uiconst.TOPLEFT)
        self.sr.label = label



    def Prepare_Hilite_(self, *args):
        self.sr.hilite = uicls.Fill(parent=self, color=(1.0, 1.0, 1.0, 0.25), pos=(0, 1, 0, 0))




